package com.design.yjx.composite;

/**
 * @author yuanjianxin
 * @date 2017/8/28 10:35
 */
public class QuackCounter implements Quackable {
    private Quackable quackable;
    private static int count;

    public QuackCounter(Quackable quackable) {
        this.quackable = quackable;
    }

    @Override
    public void quack() {
        quackable.quack();
        count++;
    }

    public static int count() {
        return count;
    }
}
